﻿


/*========================================================================================
//Goodasong -- MySnake
//创建者: 郑雪松
//创建时间：2013年8月24日
//类描述：实体类 MdBadWords (属性说明自动提取数据库字段的描述信息)
//最后修改者:郑雪松
//最后修改时间:2013年8月24日	
=========================================================================================*/
using System;
using System.Web;
using System.Runtime.Serialization;

namespace COM.PreAlarm.Model
{
    /// <summary>
    /// 实体类 MdBadWords (属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]	  
    [Model(Name = "MdBadWords", PrimaryKey = "BadWords_ID", ModelType = ModelType.Table, Condition = "1=1", IsNeedRecordModify = true)]
    public partial class MdBadWordsInfo : BaseModel
    {
        public MdBadWordsInfo()
        {            
            PrimaryKey = "BadWords_ID"; 
			Fields.Add("BadWords_ID");//BadWords_ID
			Fields.Add("BadWords");//敏感词
			Fields.Add("IsValid");//是否生效
			Fields.Add("LastEditBy");//编辑人
			Fields.Add("LastEditDate");//编辑日期
			
			
			CanNotNullFields.Add("BadWords_ID");//BadWords_ID不能为空!				
			
			CanNotNullFields.Add("BadWords");//敏感词不能为空!				
			this.OnCreated();			
			this.OnModelCreated();
        }
		public MdBadWordsInfo(bool isNewInfo):this()
        {
			IsNew = isNewInfo;
		}
		#region 方法

        public void OnCreated() { this.SetPrimaryKeyValue(); }		

		public override void SetPrimaryKeyValue()
        {
			
            BadWords_ID = Guid.NewGuid();
        }
        #endregion 
		
		#region 成员变量
				
		private Guid _BadWords_ID;//BadWords_ID
		private string _BadWords;//敏感词
		private bool _IsValid;//是否生效
		private string _LastEditBy;//编辑人
		private DateTime _LastEditDate;//编辑日期
		
		#endregion
		
		#region 属性 
		
		/// <summary>
        /// BadWords_ID
        /// </summary>       
		[ModelField(Description = "BadWords_ID", Type = typeof(Guid), ErrorMessage = "BadWords_ID信息错误!", FieldType = FieldType.Normal, IsKeyField = true,IsUnique = true, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 16,  DbType = "uniqueidentifier", IsNeedRecordModify = true)]
        public virtual Guid BadWords_ID
        {
            get
            {
                return this._BadWords_ID;
            }
            set
            {
                if (_BadWords_ID != value || (_BadWords_ID == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("MdBadWords", "BadWords_ID", _BadWords_ID, value, "uniqueidentifier", "BadWords_ID");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnBadWords_IDChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._BadWords_ID = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnBadWords_IDChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _BadWords_ID = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 敏感词
        /// </summary>       
		[ModelField(Description = "敏感词", Type = typeof(string), ErrorMessage = "敏感词信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 50,  DbType = "nvarchar", IsNeedRecordModify = true)]
        public virtual string BadWords
        {
            get
            {
                return this._BadWords;
            }
            set
            {
                if (_BadWords != value || (_BadWords == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("MdBadWords", "BadWords", _BadWords, value, "nvarchar", "敏感词");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnBadWordsChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._BadWords = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnBadWordsChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _BadWords = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 是否生效
        /// </summary>       
		[ModelField(Description = "是否生效", Type = typeof(bool), ErrorMessage = "是否生效信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 1,  DbType = "bit", IsNeedRecordModify = true)]
        public virtual bool IsValid
        {
            get
            {
                return this._IsValid;
            }
            set
            {
                if (_IsValid != value || (_IsValid == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("MdBadWords", "IsValid", _IsValid, value, "bit", "是否生效");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnIsValidChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._IsValid = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnIsValidChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _IsValid = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 编辑人
        /// </summary>       
		[ModelField(Description = "编辑人", Type = typeof(string), ErrorMessage = "编辑人信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 50,  DbType = "varchar", IsNeedRecordModify = true)]
        public virtual string LastEditBy
        {
            get
            {
                return this._LastEditBy;
            }
            set
            {
                if (_LastEditBy != value || (_LastEditBy == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("MdBadWords", "LastEditBy", _LastEditBy, value, "varchar", "编辑人");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnLastEditByChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._LastEditBy = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnLastEditByChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _LastEditBy = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 编辑日期
        /// </summary>       
		[ModelField(Description = "编辑日期", Type = typeof(DateTime), ErrorMessage = "编辑日期信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 8,  DbType = "datetime", IsNeedRecordModify = true)]
        public virtual DateTime LastEditDate
        {
            get
            {
                return this._LastEditDate;
            }
            set
            {
                if (_LastEditDate != value || (_LastEditDate == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("MdBadWords", "LastEditDate", _LastEditDate, value, "datetime", "编辑日期");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnLastEditDateChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._LastEditDate = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnLastEditDateChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _LastEditDate = value;
                    }
                }
            }
        }
		#endregion 属性
				  
		#region 属性更改事件
		
		partial void OnBadWords_IDChanging(ModifyInfo modifyInfo);//BadWords_IDBadWords_ID改变之前发生
        partial void OnBadWords_IDChanged(ModifyInfo modifyInfo);//BadWords_IDBadWords_ID改变之后发生
		partial void OnBadWordsChanging(ModifyInfo modifyInfo);//敏感词BadWords改变之前发生
        partial void OnBadWordsChanged(ModifyInfo modifyInfo);//敏感词BadWords改变之后发生
		partial void OnIsValidChanging(ModifyInfo modifyInfo);//是否生效IsValid改变之前发生
        partial void OnIsValidChanged(ModifyInfo modifyInfo);//是否生效IsValid改变之后发生
		partial void OnLastEditByChanging(ModifyInfo modifyInfo);//编辑人LastEditBy改变之前发生
        partial void OnLastEditByChanged(ModifyInfo modifyInfo);//编辑人LastEditBy改变之后发生
		partial void OnLastEditDateChanging(ModifyInfo modifyInfo);//编辑日期LastEditDate改变之前发生
        partial void OnLastEditDateChanged(ModifyInfo modifyInfo);//编辑日期LastEditDate改变之后发生
		
		#endregion		
		public virtual string DetailURI { get; set; }
        public virtual string DetailHTMLURI { get; set; }
		public virtual string ManageEditURI {get; set;}
		public virtual string ManageDetailURI {get; set;}
		public override void OnLoaded()
        {
            base.OnLoaded();	
			DetailURI = ZModel.InitDetailURI("MdBadWords", "BadWords_ID", BadWords_ID);
            DetailHTMLURI = ZModel.InitDetailHTMLURI("MdBadWords", "BadWords_ID", BadWords_ID);		
			ManageEditURI = ZModel.InitMEditURI("MdBadWords", "BadWords_ID", BadWords_ID);	
		 	ManageDetailURI = ZModel.InitMDetailURI("MdBadWords", "BadWords_ID", BadWords_ID);	
			OnModelLoaded();
        }
		
		partial void OnModelCreated();
        partial void OnModelLoaded();
	}	
}